import { createRouter,createWebHashHistory} from "vue-router";

const routes = [
  { 
    path: "/login",
    component: () => import('@/views/Login.vue')
  },
  {
    path: "/",
    component: () => import('@/components/layout.vue'),
    redirect: '/bulletin-board',
    children: [
      {
        path: '/index',
        component: () => import('@/views/Main/index.vue')
      },
      /** 看板数据 路由 start */
      {
        path: '/bulletin-board',
        name: 'bulletin-board',
        component: () => import('@/views/BulletinBoard/index.vue'),
        meta: {
          keepAlive: true
        }
      },
      {
        path: '/bulletin-board-more',
        component: () => import('@/views/BulletinBoard/morePage.vue'),
      },
      {
        path: '/bulletin-board-look-source',
        component: () => import('@/views/BulletinBoard/LookSource.vue')
      },
      /** 看板数据 路由 end */

      /** 数据分析 路由 start */
      {
        path: '/data-analysis',
        name: 'data-analysis',
        component: () => import('@/views/DataAnalysis/index.vue'),
        meta: {
          keepAlive: true
        }
      },
      /** 数据分析 路由 end */

      /** 账号关联 路由 start */
      {
        path: '/account-association',
        component: () => import('@/views/index.vue'),
        meta: {
          title: '账号关联'
        },
        children: [
          {
            path: '/account-association/media-manage',
            component: () => import('@/views/AccountAssociation/MediaManage.vue'),
            meta: {
              title: '媒体管理',
              desc: '管理新增媒体账号绑定投手',
              keepAlive: true
            }
          },
          {
            path: '/account-association/platform-sharing',
            component: () => import('@/views/AccountAssociation/PlatformSharing.vue'),
            meta: {
              title: '平台分成',
              desc: '管理平台分成及投手绑定',
              keepAlive: true
            }
          },
          {
            path: '/account-association/agent-rebate',
            component: () => import('@/views/AccountAssociation/AgentRebate.vue'),
            meta: {
              title: '代理返点',
              desc: '管理代理返点及媒体绑定'
            }
          },
          {
            path: '/account-association/look-account',
            component: () => import('@/views/AccountAssociation/LookAccount.vue'),
            meta: {
              title: '查看账户',
              desc: '查看投手媒体及书城关联账户'
            }
          },
        ]
      },
      /** 账号关联 路由 end */

      /** 权限管理 路由 start */
      {
        path: '/permission-manage',
        component: () => import('@/views/index.vue'),
        meta: {
          title: '权限管理'
        },
        children: [
          {
            path: '/permission-manage/module-manage',
            component: () => import('@/views/PermissionManage/ModuleManage.vue'),
            meta: {
              title: '模块管理',
              desc: '用于管理系统模块'
            }
          },
          {
            path: '/permission-manage/role-manage',
            component: () => import('@/views/PermissionManage/RoleManage.vue'),
            meta: {
              title: '角色管理',
              desc: '用于管理用户角色创建'
            }
          },
          {
            path: '/permission-manage/user-manage',
            component: () => import('@/views/PermissionManage/UserManage.vue'),
            meta: {
              title: '用户管理',
              desc: '管理及创建用户'
            }
          },
          {
            path: '/permission-manage/person-setting',
            component: () => import('@/views/PermissionManage/PersonSetting.vue'),
            meta: {
              title: '个人设置',
              desc: '管理用户个人账户'
            }
          },
        ]
      },
      /** 权限管理 路由 start */

      /** 系统设置 路由 start */
      {
        path: '/system-setting',
        component: () => import('@/views/index.vue'),
        meta: {
          title: '系统设置'
        },
        children: [
          {
            path: '/system-setting/setting',
            component: () => import('@/views/SystemSetting/setting.vue'),
            meta: {
              title: '配置管理',
              desc: '管理系统相关配置文件'
            }
          },
          {
            path: '/system-setting/log',
            component: () => import('@/views/SystemSetting/log.vue'),
            meta: {
              title: '系统日志',
              desc: '查看系统操作日志'
            }
          }
        ]
      },
      /** 系统设置 路由 end */
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes: routes
})

export default router